﻿Public Class PersonelListe
    Inherits ProcessReport

    Public Overrides Sub GenericEvent(ByVal e As ProcessEventArgs)
        Select Case e.EventType
            Case EventType.Initialize
				Text = "Personel listesi"
                InitialHelp = "Rapor parametrelerini girin."
                AddCombo("@bolge", "Bölge", "1,LEFKOŞA|2,GİRNE|3,MAĞUSA|4,İSKELE|5,GÜZELYURT|6,LEFKE|7,MERKEZ", "width=10;nl")
                AddCombo("statu", "Statü", SysKod.Get("03.01"), "width=20")
                AddCombo("durum", "Durum", SysKod.Get("03.02"), "width=17;nl")
            Case EventType.ValidateForm
				Q("select a.adi,a.soyadi,a.kimlik,a.dtar")
				Q("from muhasebe..pergenel a")
				Q("inner join syskod2 b on a.statu=b.kod")
				Q("inner join syskod2 c on a.perdrm=c.kod")
				Q("where 1=1")
				If Not IsEmpty("bolge") Then Q("and a.gorevyers=" & Input("bolge"))
				If Not IsEmpty("statu") Then Q("and a.statu='" & Input("statu") & "'")
				If Not IsEmpty("durum") Then Q("and a.perdrm='" & Input("durum") & "'")
				Q("order by a.soyadi,a.adi")
                Rs = Remote.OpenSQL("*")
                e.Result = True
            Case EventType.PageHeader
                Report.SetColumns("Adı soyadı;Kimlik no.;Doğum tar.", "3;1;1;", "l;c;d", "--")
            Case EventType.ReportDetail
                Do Until Rs.EOF
                    Report.Print(Trim(Rs("adi")) & " " & Trim(Rs("soyadi")), Rs("kimlik"), Rs("dtar"))
                    Rs.MoveNext()
                Loop
        End Select
    End Sub

End Class
